# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=perl-perl-critic
pkgver=1.148
pkgrel=1
pkgdesc="Critique Perl source code for best-practices"
arch=('any')
license=('PerlArtistic')
url="https://metacpan.org/release/Perl-Critic"
depends=('perl-b-keywords' 'perl-config-tiny' 'perl-exception-class' 'perl-file-homedir'
         'perl-file-which' 'perl-list-someutils' 'perl-module-build' 'perl-module-pluggable'
         'perl-ppi' 'perl-ppix-quotelike' 'perl-ppix-regexp' 'perl-ppix-utilities' 'perl-pod-spell'
         'perl-tidy' 'perl-readonly' 'perl-string-format')
checkdepends=('perl-test-memory-cycle')
options=('!emptydirs')
source=("https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/Perl-Critic-$pkgver.tar.gz")
sha512sums=('833e29f6bb91811180fc668d5f9feb1fdee8d4f18a7703cff0c6cfb73953e527f7b568836741c59b5d80bd9d56ce82cdeb5dc627df83823cb0fb9f4eac924ce0')

build() {
  cd Perl-Critic-$pkgver
  perl Build.PL installdirs=vendor
  perl Build
}

check() {
  cd Perl-Critic-$pkgver
  perl Build test
}

package() {
  cd Perl-Critic-$pkgver
  perl Build install destdir="$pkgdir"
}
